function R = nonaninf(A)
%       R = nonaninf(A)
%
% R is 0 if at least an element of A is NaN or Inf or -Inf, and is 1
% everywhere.

% G. Teza, 2005

if (sum(isnan(A(:))) > 0) || (sum(isinf(A(:))) > 0)
    R = false;
else
    R = true;
end